package com.hyperchain.config.mq.topic;


import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class MsgSender {

    @Resource
    private AmqpTemplate rabbitTemplate;

    public void send1(String msg) {
        System.out.println("Sender : " + msg);
        rabbitTemplate.convertAndSend("mybootexchange", "topic.message", msg);
    }


    public void send2(String msg) {
        System.out.println("Sender : " + msg);
        rabbitTemplate.convertAndSend("mybootexchange", "topic.messages", msg);
    }
}


